#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[100010];
int n, m;
int erfen(int k)
{
    int left = 0, right = n - 1, b = 0;
    while (left <= right)
    {
        int mid = (left + right) / 2;
        if (k == a[mid])
        {
            b = 1;
            return b;
        }

        if (k < a[mid])
        {
            right = mid - 1;
        }
        else
        {
            left = mid + 1;
        }
    }
    int mid = (left + right) / 2;
    if (k == a[mid])
    {
        b = 1;
        return b;
    }
    return b;
}
int main()
{
    scanf("%d %d", &n, &m);
    int k, t;
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);

    sort(a, a + n);

    for (int i = 1; i <= m; i++)
    {
        scanf("%d", &k);
        t = erfen(k);
        if (t == 1)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}
